home *** CD-ROM | disk | FTP | other *** search
- //: C25:Glass.h
- // From Thinking in C++, 2nd Edition
- // Available at http://www.BruceEckel.com
- // (c) Bruce Eckel 1999
- // Copyright notice in Copyright.txt
- // The Glass class with prototyping
- #ifndef GLASS_H
- #define GLASS_H
- #include "Trash.h"
-
- class Glass : public Trash {
- static double val;
- protected:
- Glass() {}
- friend class TrashPrototypeInit;
- public:
- Glass(double wt) : Trash(wt) {}
- double value() const { return val; }
- static void value(double newVal) {
- val = newVal;
- }
- std::string id() { return "Glass"; }
- Trash* clone(const Info& info) {
- return new Glass(info.data());
- }
- };
- #endif // GLASS_H ///:~
-